{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "from sklearn.metrics import r2_score\n",
    "from sklearn.metrics import explained_variance_score\n",
    "from sklearn.metrics import mean_absolute_error\n",
    "from sklearn.metrics import mean_squared_error\n",
    "from sklearn.metrics import mean_absolute_percentage_error\n",
    "import matplotlib.pyplot as plt\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "/Users/gengyunxin/Documents/项目/traffic_model/TVTS_9.28/finetune/test_result_all/complement_1223/Complement_Result12_12_output12.csv\n",
      "   Unnamed: 0   Input288  Position   Comple12    Input12\n",
      "0           0  32.917930       0.0  12.275880  11.104292\n",
      "1           1  34.431610       0.0  12.055294  10.753576\n",
      "2           2  36.693010       0.0  11.682368   9.627980\n",
      "3           3  35.077507       0.0  12.270804   9.356650\n",
      "4           4  32.064587       0.0  11.856357   9.797209\n",
      "MAE:  5.995556682211955\n",
      "RMSE:  8.780736560955328\n",
      "MAPE:  621638.2083388618\n",
      "R2:  0.9902187109777756\n"
     ]
    }
   ],
   "source": [
    "folder = '/Users/gengyunxin/Documents/项目/traffic_model/TVTS_9.28/finetune/test_result_all/complement_1223'\n",
    "mae_list = []\n",
    "rmse_list = []\n",
    "mape_list = []\n",
    "r2_list = []\n",
    "# for com_len in [12]:\n",
    "#     for word_len in [24]:\n",
    "word_len = 12\n",
    "com_len = 12\n",
    "\n",
    "input36 = []\n",
    "comple36 = []\n",
    "file = folder + f'/Complement_Result{word_len}_{com_len}_output{com_len}.csv'\n",
    "print(file)\n",
    "\n",
    "df = pd.read_csv(file)\n",
    "print(df.head())\n",
    "# print(len(df['Position']))\n",
    "# print(np.isnan(df).any())\n",
    "# for i, pos in enumerate(df['Position']):\n",
    "#     if pos==1.0:\n",
    "#         input36.append(df['Input288'].iloc[i])\n",
    "#         comple36.append(df['Complementation'].iloc[i])\n",
    "# print(len(input36))\n",
    "# input_min = np.array(input36).min()\n",
    "# input_min_arg = np.argmin((np.array(input36)))\n",
    "# print(input_min)\n",
    "# print(input_min_arg)\n",
    "# print(len(comple36))\n",
    "# print('comple: ', comple36[:com_len*5])\n",
    "# np.savetxt(f'input_{word_len}_{com_len}.csv', input36, delimiter=',')\n",
    "# np.savetxt(f'comple_{word_len}_{com_len}.csv', comple36, delimiter=',')\n",
    "input36 = df['Input12'][:89856]\n",
    "comple36 = df['Comple12'][:89856]\n",
    "\n",
    "mae = mean_absolute_error(input36, comple36)\n",
    "rmse = mean_squared_error(input36, comple36, squared=False)\n",
    "mape = mean_absolute_percentage_error(input36, comple36)\n",
    "r2 = r2_score(input36, comple36)\n",
    "print('MAE: ', mae)\n",
    "print('RMSE: ', rmse)\n",
    "print('MAPE: ', mape)\n",
    "print('R2: ', r2 )\n",
    "# mae_list.append(mae)\n",
    "# rmse_list.append(rmse)\n",
    "# mape_list.append(mape)\n",
    "# r2_list.append(r2)\n",
    "\n",
    "# print('K1C12 K2C12 K6C12 K12C12 K24C12 K1C36 K2C36 K6C36 K12C36 K24C36')\n",
    "# print('MAE: ', mae_list)\n",
    "# print('RMSE: ', rmse_list)\n",
    "# print('MAPE: ', mape_list)\n",
    "# print('R2: ', r2_list)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.0004562856125356125\n",
      "0.0008457977207977208\n",
      "0.00046741452991452993\n",
      "0.0019253027065527066\n",
      "0.05137108262108262\n",
      "0.2532719017094017\n",
      "0.2393051103988604\n",
      "0.4528133903133903\n"
     ]
    }
   ],
   "source": [
    "# 补全 K12C12 输入分布\n",
    "a,b,c,d,e,f,g,h = [],[],[],[],[],[],[],[]\n",
    "yy = []\n",
    "input_array = input36\n",
    "comple_array = comple36\n",
    "# print(input_array)\n",
    "for i, input in enumerate(input_array):\n",
    "    if input<0.00001:\n",
    "        a.append(input_array[i])\n",
    "        yy.append(comple_array[i])\n",
    "    if 0.00001<=input<0.001:\n",
    "        b.append(input_array[i])\n",
    "        yy.append(comple_array[i])\n",
    "    elif 0.001<=input<0.1:\n",
    "        c.append(input_array[i])\n",
    "        yy.append(comple_array[i])\n",
    "    elif 0.1<=input<1:\n",
    "        d.append(input_array[i])\n",
    "    elif 1<=input<10:\n",
    "        e.append(input_array[i])\n",
    "    elif 10<=input<50:\n",
    "        f.append(input_array[i])\n",
    "    elif 50<=input<100:\n",
    "        g.append(input_array[i])\n",
    "    else:\n",
    "        h.append(input_array[i])\n",
    "\n",
    "print(len(a) / len(input_array))\n",
    "print(len(b) / len(input_array))\n",
    "print(len(c) / len(input_array))\n",
    "print(len(d) / len(input_array))\n",
    "print(len(e) / len(input_array))\n",
    "print(len(f) / len(input_array))\n",
    "print(len(g) / len(input_array))\n",
    "print(len(h) / len(input_array))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "332\n",
      "332\n",
      "89524\n",
      "89524\n",
      "5.977374590894063\n",
      "8.768976063242004\n",
      "0.14211129678628137\n",
      "0.9902250161265717\n"
     ]
    }
   ],
   "source": [
    "a,b,c,d,e,f,g,h = [],[],[],[],[],[],[],[]\n",
    "yy = []\n",
    "yyy = []\n",
    "# print(input_array)\n",
    "for i, input in enumerate(input_array):\n",
    "    if input<=1:\n",
    "        a.append(input)\n",
    "        yy.append(comple_array[i])\n",
    "    else:\n",
    "        b.append(input)\n",
    "        yyy.append(comple_array[i])\n",
    "print(len(a))\n",
    "print(len(yy))\n",
    "print(len(b))\n",
    "print(len(yyy))\n",
    "mape2 = mean_absolute_percentage_error(b, yyy)\n",
    "mae2 = mean_absolute_error(b, yyy)\n",
    "rmse2 = mean_squared_error(b, yyy, squared=False)\n",
    "r22 = r2_score(b, yyy)\n",
    "print(mae2)\n",
    "print(rmse2)\n",
    "print(mape2)\n",
    "print(r22)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "/Users/gengyunxin/Documents/项目/traffic_model/TVTS_9.28/finetune/test_result_all/complementation_result/Complement_Result6_12_0.csv\n",
      "   Unnamed: 0  Complementation   Input288  Input48  Position\n",
      "0           0        35.750294  32.917930      0.0       0.0\n",
      "1           1        36.955853  34.431610      0.0       0.0\n",
      "2           2        37.220700  36.693010      0.0       0.0\n",
      "3           3        35.147266  35.077507      0.0       0.0\n",
      "4           4        33.831703  32.064587      0.0       0.0\n",
      "2156544\n",
      "Unnamed: 0         False\n",
      "Complementation    False\n",
      "Input288           False\n",
      "Input48            False\n",
      "Position           False\n",
      "dtype: bool\n",
      "89856\n",
      "6.079969299999999e-10\n",
      "9515\n",
      "89856\n",
      "K1C12 K2C12 K6C12 K12C12 K24C12 K1C36 K2C36 K6C36 K12C36 K24C36\n",
      "MAE:  [7.066628369462033]\n",
      "RMSE:  [9.635185633970243]\n",
      "MAPE:  [1758287.7744988254]\n",
      "R2:  [0.9877031483472487]\n"
     ]
    }
   ],
   "source": [
    "folder = '/Users/gengyunxin/Documents/项目/traffic_model/TVTS_9.28/finetune/test_result_all/complementation_result'\n",
    "mae_list = []\n",
    "rmse_list = []\n",
    "mape_list = []\n",
    "r2_list = []\n",
    "# for com_len in [12]:\n",
    "#     for word_len in [24]:\n",
    "word_len = 6\n",
    "com_len = 12\n",
    "\n",
    "input36 = []\n",
    "comple36 = []\n",
    "file = folder + f'/Complement_Result{word_len}_{com_len}_0.csv'\n",
    "print(file)\n",
    "\n",
    "df = pd.read_csv(file)\n",
    "print(df.head())\n",
    "print(len(df['Position']))\n",
    "print(np.isnan(df).any())\n",
    "for i, pos in enumerate(df['Position']):\n",
    "    if pos==1.0:\n",
    "        input36.append(df['Input288'].iloc[i])\n",
    "        comple36.append(df['Complementation'].iloc[i])\n",
    "print(len(input36))\n",
    "input_min = np.array(input36).min()\n",
    "input_min_arg = np.argmin((np.array(input36)))\n",
    "print(input_min)\n",
    "print(input_min_arg)\n",
    "print(len(comple36))\n",
    "# print('comple: ', comple36[:com_len*5])\n",
    "# np.savetxt(f'input_{word_len}_{com_len}.csv', input36, delimiter=',')\n",
    "# np.savetxt(f'comple_{word_len}_{com_len}.csv', comple36, delimiter=',')\n",
    "mae = mean_absolute_error(input36, comple36)\n",
    "rmse = mean_squared_error(input36, comple36, squared=False)\n",
    "mape = mean_absolute_percentage_error(input36, comple36)\n",
    "r2 = r2_score(input36, comple36)\n",
    "mae_list.append(mae)\n",
    "rmse_list.append(rmse)\n",
    "mape_list.append(mape)\n",
    "r2_list.append(r2)\n",
    "\n",
    "print('K1C12 K2C12 K6C12 K12C12 K24C12 K1C36 K2C36 K6C36 K12C36 K24C36')\n",
    "print('MAE: ', mae_list)\n",
    "print('RMSE: ', rmse_list)\n",
    "print('MAPE: ', mape_list)\n",
    "print('R2: ', r2_list)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "file = '/Users/gengyunxin/Documents/项目/traffic_model/TVTS_9.28/finetune/test_result_all/1126/Complement_Result6_12_0.csv'\n",
    "# for chunk in pd.read_csv(file, chunksize=288):\n",
    "df = pd.read_csv(file)\n",
    "df1 = df[df['Position']==1.0]\n",
    "df1.to_excel('/Users/gengyunxin/Documents/项目/traffic_model/TVTS_9.28/finetune/test_result_all/1126/6_12_0.xlsx')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(2156544, 5)"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(89856, 5)"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "373\n",
      "373\n",
      "89483\n",
      "89483\n",
      "7.023714893713364\n",
      "9.547173149342003\n",
      "0.15909727317226224\n",
      "0.9878996498382316\n"
     ]
    }
   ],
   "source": [
    "a,b,c,d,e,f,g,h = [],[],[],[],[],[],[],[]\n",
    "yy = []\n",
    "yyy = []\n",
    "input_array = list(df1['Input288'])\n",
    "comple_array = list(df1['Complementation'])\n",
    "# print(input_array)\n",
    "for i, input in enumerate(input_array):\n",
    "    if input<=1:\n",
    "        a.append(input)\n",
    "        yy.append(comple_array[i])\n",
    "    else:\n",
    "        b.append(input)\n",
    "        yyy.append(comple_array[i])\n",
    "print(len(a))\n",
    "print(len(yy))\n",
    "print(len(b))\n",
    "print(len(yyy))\n",
    "mape1 = mean_absolute_percentage_error(a, yy)\n",
    "mape2 = mean_absolute_percentage_error(b, yyy)\n",
    "mae2 = mean_absolute_error(b, yyy)\n",
    "rmse2 = mean_squared_error(b, yyy, squared=False)\n",
    "r22 = r2_score(b, yyy)\n",
    "print(mae2)\n",
    "print(rmse2)\n",
    "print(mape2)\n",
    "print(r22)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 补全 K24C12 输入分布\n",
    "a,b,c,d,e,f,g,h = [],[],[],[],[],[],[],[]\n",
    "yy = []\n",
    "input_array = list(df1['Input288'])\n",
    "comple_array = list(df1['Complementation'])\n",
    "# print(input_array)\n",
    "for i, input in enumerate(input_array):\n",
    "    if input<0.00001:\n",
    "        a.append(input_array[i])\n",
    "        yy.append(comple_array[i])\n",
    "    if 0.00001<=input<0.001:\n",
    "        b.append(input_array[i])\n",
    "        yy.append(comple_array[i])\n",
    "    elif 0.001<=input<0.1:\n",
    "        c.append(input_array[i])\n",
    "        yy.append(comple_array[i])\n",
    "    elif 0.1<=input<1:\n",
    "        d.append(input_array[i])\n",
    "    elif 1<=input<10:\n",
    "        e.append(input_array[i])\n",
    "    elif 10<=input<50:\n",
    "        f.append(input_array[i])\n",
    "    elif 50<=input<100:\n",
    "        g.append(input_array[i])\n",
    "    else:\n",
    "        h.append(input_array[i])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.0006788639601139602\n",
      "0.000968215811965812\n",
      "0.000734508547008547\n",
      "0.001880787037037037\n",
      "0.05883858618233618\n",
      "0.28626914173789175\n",
      "0.24091880341880342\n",
      "0.41038995726495725\n"
     ]
    }
   ],
   "source": [
    "print(len(a) / len(df1['Input288']))\n",
    "print(len(b) / len(df1['Input288']))\n",
    "print(len(c) / len(df1['Input288']))\n",
    "print(len(d) / len(df1['Input288']))\n",
    "print(len(e) / len(df1['Input288']))\n",
    "print(len(f) / len(df1['Input288']))\n",
    "print(len(g) / len(df1['Input288']))\n",
    "print(len(h) / len(df1['Input288']))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[3.1787902999999997, -0.93565774, -1.5217032, -1.7081243000000002, 6.057506, 5.0957932, 4.0666547, 2.3917203, -2.6921522999999996, -10.120265, -2.0852282, -2.2005908, -0.97703356, 0.93494433, 3.0117347000000003, -3.5781775000000002, 4.4567904, 6.2835529999999995, 4.0350676, 4.8186855, 8.164361, 8.599641, 10.339363, 16.562569, 13.625129000000001, 9.743803, 7.9232397, 8.20336, 9.876155, 2.2854269, 14.302152, 15.833979000000001, 12.736286, -14.135585999999998, -5.1962624, -8.014992, 11.94098, 2.80823, 8.181414, 5.194311, 2.7392792999999998, 1.6100762, 13.295364000000001, 11.806225, 10.51876, 22.518906, 24.58316, 3.6644495000000004, 6.6577915999999995, 7.0116935, 3.5690513, 4.7977742999999995, 4.778867, 7.525396300000001, 5.4971676, 7.256752499999999, 2.7813776000000003, 12.018048, 9.992552, 14.544285999999998, 14.771809, 15.036052999999999, 11.059444000000001, 14.824735999999998, 12.423009, 12.773992, 14.030057000000001, 12.678803, 8.625958, 13.547253, 6.1791334, 9.500911, 8.29927, 1.4332341, 4.812303, 7.918139, 7.3632255, 5.590574299999999, 11.950042, 8.245755, 15.227965, 16.757044, 15.08779, 19.397852, 15.931642000000002, 13.059573, 25.552252, 11.921702999999999, 17.038904000000002, 27.445422999999998, 17.077103, 19.885618, 26.9227, 32.227253000000005, 11.310856, 17.004362, 13.747266, 12.558425, 12.955202, 8.544045, 10.374919, 11.457369, 13.204547, 9.116308, 9.372593, 9.084111, 9.465655, 9.090795, 10.964101, 7.37092, 13.485133, 15.150360000000001, 9.973135000000001, 10.080893, 9.031733500000001, 5.3064919999999995, 10.808366, 7.5126686000000005, 14.751, 12.763586, 12.809412, 15.88149, 24.090206, 17.971327, 13.6065645, 22.156963, 15.294751999999999, 21.116621, 20.874727, 19.023592, 13.417292999999999, 15.869233, 8.638534, 15.853955, 17.895391, 13.374781, 11.817117999999999, 13.615309, 16.192528, 15.185191, 9.969139, 11.432656, 5.495655, 7.275906, 3.9243796000000004, 8.214483999999999, 6.1262665, 7.128458999999999, 5.209457, 8.314817, 9.672592, 8.972731, 8.61856, 8.937906, 6.078984999999999, 4.0041814, 7.310261200000001, 5.904786, 11.447544, 7.848921000000001, 5.846888, 1.3822768, 1.2678806, 2.7022169, 5.798396, 10.032967, 6.082141, 12.063711, 15.21553, 8.462816, 17.828394, 18.104029, 15.400331, 15.339628, 11.311145, 8.473479, 16.279211, 12.864019, 4.691475, 5.083724500000001, 7.9553556, 7.706562, 7.251262, 7.218211999999999, 5.247241000000001, 4.216653, 8.049467, 7.878024000000001, 6.4179, 7.4797210000000005, 19.21099, 19.571163000000002, 17.277365, 15.429751999999999, 12.972430000000001, 12.554219, 17.462912, 14.184462, 14.169556, 17.00219, 14.819405, 12.314076, 11.690164, 16.159544, 12.848102, 14.590379, 17.211773, 14.021953, 16.125774, 11.766069, 14.875942000000002, 15.76345, 13.518985, 17.52058]\n"
     ]
    }
   ],
   "source": [
    "print(yy)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0.056074766355140186, 0.0, 0.004672897196261682, 0.43457943925233644, 0.5046728971962616, 0.0]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<BarContainer object of 6 artists>"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD4CAYAAAD8Zh1EAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAANAUlEQVR4nO3df6jd913H8efL2walOgbm4kqSLkGDpUrVco1KxV9YSX9gOhyYqhvqRohY3RBx8Z+B7J/2HxmyaggziCiGQbcR1mx16GSObS63ta2mXcYlVnJNpVmnq8Fhl+7tHzmT4+3NPd/kntuT+87zAZec7/f74dz3l5AnX76553tTVUiSNr9vmfUAkqTpMOiS1IRBl6QmDLokNWHQJamJG2b1jbdu3Vo7d+6c1beXpE3piSee+HJVza92bGZB37lzJ4uLi7P69pK0KSX518sd85aLJDVh0CWpCYMuSU0YdElqwqBLUhMGXZKaMOiS1MSgoCfZm+R0kqUkh1Y5/lNJvprkqdHXe6c/qiRpLRM/WJRkDngEuAtYBk4mOV5Vz65Y+vdVdd8GzChJGmDIJ0X3AEtVdQYgyTFgH7Ay6JI2kZ2HHpv1CIM8/9C9sx5h0xhyy2UbcHZse3m0b6UfS/J0ko8n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0Hkm+NckXkjw9Op8/mPVM05JkLsk/JvnYrGdZryTPJ/mnJE8lWZz1PENc9/fQR482+BJjjzYAHljxaINNJclPABe49Ond75/1POs1+tTxzVX1ZJLvAJ4A7t+sf0dJAtxUVReS3Ah8BnjX6FPWm1qS3wEWgDdU1X2znmc9kjwPLFTVtfShojV5hT7s0QabSlV9GvjKrOeYlqp6oaqeHL3+L+A5Ln0SeVMaPSLjwmjzxtHXpr+ySrIduBf44KxnuV4Z9Ms/tkDXoCQ7gR8C/mHGo6zL6NbEU8CLwCeralOfz8j7gd8DvjHjOaalgL9O8sTosSXXPIM+8LEFmr0k3w48Cry7ql6e9TzrUVWvVtUPculT1XuSbOpbY0nuA16sqidmPcsU3VlVd3DpabK/ObqVeU0z6D62YFMY3Wt+FPjLqvrwrOeZlqr6T+DvgL2znWTd7gR+fnTf+RjwM0n+YrYjrU9VnRv9+SLwES7dnr2mGfRhjzbQDI3+E/FPgeeq6g9nPc96JZlP8sbR628Dfhb44kyHWqeq+v2q2l5VO7n0b+hvq+pXZjzWVUty0+g/4ElyE/BzwDX/U2PXfdCr6iLwzUcbPAd8qKpOzXaq9UnyV8DngO9NspzkHbOeaZ3uBN7Gpau+p0Zf98x6qHW4GfhUkme4dEHxyara9D/m18x3AZ9J8jTwBeCxqvrEjGea6Lr/sUVJ6uK6v0KXpC4MuiQ1YdAlqQmDLklNGHRJasKgS1ITBl2SmvhfPiA8n5U2HHMAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "aa, bb,cc,dd,ee,ff = [],[],[],[],[],[]\n",
    "for y in yy:\n",
    "    if y<0:\n",
    "        aa.append(y)\n",
    "    elif 0<=y<0.1:\n",
    "        bb.append(y)\n",
    "    elif 0.1<=y<1:\n",
    "        cc.append(y)\n",
    "    elif 1<=y<10:\n",
    "        dd.append(y)\n",
    "    elif 10<=y<50:\n",
    "        ee.append(y)\n",
    "    else:\n",
    "        ff.append(y)\n",
    "x = np.arange(6)\n",
    "Y = [len(m)/len(yy) for m in [aa,bb,cc,dd,ee,ff]]\n",
    "print(Y)\n",
    "plt.bar(x, height=Y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [],
   "source": [
    "y = [len(m)/len(df1['Input288']) for m in [a,b,c,d,e,f,g]]\n",
    "x = np.arange(7)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<BarContainer object of 7 artists>"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD4CAYAAADiry33AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAARyElEQVR4nO3db4hd933n8feno4rtqg6BaJoGSV5pG1EjStyaWSWLQ7LeXRspLlVCC5XbJvRPEIKobShlq+6DlJInNixLCKgRwtFuy9YrShMVUU8th3YXb0ndatT12pZjhUHVolklaJykzbopVZR8+2COwtX4SveMNFd35pf3C4Z7zu/Pud8rxEdHvznn3FQVkqR2fc+kC5AkjZdBL0mNM+glqXEGvSQ1zqCXpMZtmHQBw2zevLm2b98+6TIkad04e/bsa1U1PaxvTQb99u3bmZubm3QZkrRuJPm/N+tz6UaSGmfQS1LjDHpJapxBL0mNM+glqXEGvSQ1zqCXpMYZ9JLUOINekhq3Ju+MlaS7Yfvhpyddwg0uPv7oWI7rGb0kNa5X0CfZk+R8kvkkh28x7l8l+VaSn1rpXEnSeIwM+iRTwBFgL7ALeCzJrpuMewI4vdK5kqTx6XNGvxuYr6oLVXUVOAHsGzLul4HPAFduY64kaUz6BP0W4NLA/kLX9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v8Z1X1cxMu65aSbOp+OU+3/PEIsKavJquqLwOXkvxw1/TvGONj2G9Xn4eafddYj49sSPLfgX8DbE6yAPxWVX16slWN9CDwQeClbs0b4D9W1ezkShrpbcDvdldmfQ/wB1W1Li5ZXEfeCpxcOg9gA/BUVT0z2ZJ6+WXg97uTwwt0j4BZS7y8UpIa59KNJDXOoJekxhn0ktQ4g16SGmfQS1LjDHpJapxBL0mN+ycYa6o163upfgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.bar(x, height=y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0.0, 1.112891737891738e-05, 1.112891737891738e-05, 0.012364227207977209, 0.30945067663817666, 0.26617031695156695, 0.41199252136752135]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<BarContainer object of 7 artists>"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD4CAYAAADiry33AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAARlElEQVR4nO3df4hd6V3H8ffHWYMatxTMWEsSTdTgEqRbw5gqW1ZX3SXpFtOiYFZt0VpCYNNaRDT6hyL9pwsiIsSGsI0/0DWIbSS442bFH1Sp1Ux03d1sN2WIkYxpyWxbratimvbrH3MiN9Ob3DPJ3NyZx/cLhnvO8+Pc713CZ888c865qSokSe36ikkXIEkaL4Nekhpn0EtS4wx6SWqcQS9Jjbtn0gUMs2nTptq2bduky5CkdePs2bOvVNX0sL41GfTbtm1jbm5u0mVI0rqR5F9u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Nbc3/YM+hv1edyDVkG3zv1h4Per6iOTrmclul/N/wrYM9lKbukB4Ae7Ne8TwPcl+b3JljRaVV3uXq8AJ1laTl3LFoCFgd/u/oil4F9TDPob+ciGu6D7w+aHgE9U1a9Nup4+kkwneW23/dXADwAvT7SoW6iqX6iqLVW1jaV/x39RVT8+4bJuKcnG7o/zdMsfjwBr+mqyqvo0cCnJt3VN3w+suYsK/HLwAevxkQ1J/gD4XmBTkgXgl6vqQ5OtaqQHgHcAL3Rr3gC/WFWzkytppNcDv9NdmfUVwB9W1bq4ZHEdeR1wcuk8gHuAp6rqmcmW1Mt7gN/vTg4v0D0CZi3x8kpJapxLN5LUOINekhpn0EtS4wx6SWqcQS9JjTPoJalxBr0kNe5/AVzcpoYHyY8bAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 补全 K24C12 结果分布\n",
    "a,b,c,d,e,f,g = [],[],[],[],[],[],[]\n",
    "input_array = list(df1['Complementation'])\n",
    "for i, input in enumerate(input_array):\n",
    "    if 0.00001<=input<0.001:\n",
    "        a.append(input_array[i])\n",
    "    elif 0.001<=input<0.1:\n",
    "        b.append(input_array[i])\n",
    "    elif 0.1<=input<1:\n",
    "        c.append(input_array[i])\n",
    "    elif 1<=input<10:\n",
    "        d.append(input_array[i])\n",
    "    elif 10<=input<50:\n",
    "        e.append(input_array[i])\n",
    "    elif 50<=input<100:\n",
    "        f.append(input_array[i])\n",
    "    else:\n",
    "        g.append(input_array[i])\n",
    "y = [len(m)/len(df1['Input288']) for m in [a,b,c,d,e,f,g]]\n",
    "x = np.arange(7)\n",
    "print(y)\n",
    "plt.bar(x, y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0.0, 0.0, 0.00010850694444444444, 0.08906750801282051, 0.29154981303418803, 0.3022753071581197, 0.31699886485042733]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<BarContainer object of 7 artists>"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD4CAYAAADiry33AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAAPSklEQVR4nO3cb4hdeX3H8ffHiaFtusuCmeqSxCZtQ5dQdmsYomVl7bbdJdHSWPqgWayCdQmBTVWKtGkfWIpPFEopQjSENUWp2yBqINS4WekfbFm3zcRudzfrRoaYkiFKZtVqtxZj6rcP5gRuxpvcM5uZ3Jmf7xdc7jm/P+d+bwgfzvzuOSdVhSSpXa8YdwGSpOVl0EtS4wx6SWqcQS9JjTPoJalxa8ZdwDDr16+vzZs3j7sMSVo1Tp8+/WJVTQ7rW5FBv3nzZqanp8ddhiStGkn+83p9Lt1IUuMMeklqnEEvSY0z6CWpcQa9JDXOoJekxhn0ktQ4g16SGmfQS1LjVuSdsZJ0K2w+8Llxl3CN8x98y7Ic1zN6SWqcQS9JjTPoJalxBr0kNc6gl6TGGfSS1DiDXpIa1yvok+xMcjbJTJIDQ/p3J3kmydNJppO8se9cSdLyGnnDVJIJ4CDwADALnEpyvKqeHxj298DxqqokdwOfAu7qOVdSI1bSDUjLdfPRatTnjH4HMFNV56rqMnAU2D04oKpeqqrqdtcB1XeuJGl59Qn6DcCFgf3Zru0aSX47yQvA54DfX8zcbv7ebtlnem5urk/tkqQe+gR9hrTVjzRUHauqu4C3Ah9YzNxu/uGqmqqqqcnJyR5lSZL66BP0s8Cmgf2NwMXrDa6qLwI/n2T9YudKkpZen6A/BWxNsiXJWmAPcHxwQJJfSJJuezuwFvhmn7mSpOU18qqbqrqSZD9wEpgAjlTVmST7u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8CFJL/YNf06sOIuKujzULMfG6vxkQ1J/hb4VWB9klngz6rqY+OtaqR7gbcDz3Zr3gB/WlUnxlfSSHcCH++uzHoF8KmqWhWXLK4irwaOzZ8HsAZ4rKoeH29JvfwB8Mnu5PAc3SNgVhIvr5Skxrl0I0mNM+glqXEGvSQ1zqCXpMYZ9JLUOINekhpn0EtS4/4fTwSvTuNZTF4AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 预测 K24P12 输入分布\n",
    "df2 = pd.read_csv('/Users/gengyunxin/Documents/项目/traffic_model/TVTS_9.28/finetune/test_result_all/prediction_result_step36/24_12_0.1_step36.csv')\n",
    "a,b,c,d,e,f,g = [],[],[],[],[],[],[]\n",
    "input_array = list(df2['Input'])\n",
    "for i, input in enumerate(input_array):\n",
    "    if 0.00001<=input<0.001:\n",
    "        a.append(input_array[i])\n",
    "    elif 0.001<=input<0.1:\n",
    "        b.append(input_array[i])\n",
    "    elif 0.1<=input<1:\n",
    "        c.append(input_array[i])\n",
    "    elif 1<=input<10:\n",
    "        d.append(input_array[i])\n",
    "    elif 10<=input<50:\n",
    "        e.append(input_array[i])\n",
    "    elif 50<=input<100:\n",
    "        f.append(input_array[i])\n",
    "    else:\n",
    "        g.append(input_array[i])\n",
    "y = [len(m)/len(df2['Input']) for m in [a,b,c,d,e,f,g]]\n",
    "x = np.arange(7)\n",
    "print(y)\n",
    "plt.bar(x, y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0.0, 0.00025874732905982906, 0.004507211538461538, 0.11048510950854701, 0.2588474893162393, 0.312099358974359, 0.3138020833333333]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<BarContainer object of 7 artists>"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD4CAYAAADiry33AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAAPc0lEQVR4nO3df6jdd33H8efLG8O2rKVg7rQkccm2MAnDarlER6Wu21oSK4tjf6zFKXOWEGimMmTL9odj+E+FMbZBNYSaocwuDDUQ1thW9gM3arfcuK5taiOXmJFLlNyq03UOY+Z7f9xv4OR60vO9zT059358PuBwvt/Pj+95nxBefO/nfr/fm6pCktSuV0y6AEnSeBn0ktQ4g16SGmfQS1LjDHpJaty6SRcwzMaNG2vr1q2TLkOS1oyTJ0++UFXTw/pWZdBv3bqV2dnZSZchSWtGkv+8Wp9LN5LUOINekhpn0EtS4wx6SWqcQS9JjTPoJalxBr0kNc6gl6TGGfSS1LhVeWesJF0PWw88MukSrnD2gbvHclyDXtKKWU3BOa7QXItcupGkxhn0ktQ4g16SGmfQS1LjegV9kl1JTieZS3JgSP+eJE8neSrJbJK39J0rSRqvkUGfZAp4ENgN7ADuTbJjybC/B26pqjcAvwM8tIy5kqQx6nNGvxOYq6ozVXUROALsGRxQVS9WVXW7G4DqO1eSNF59gn4TcG5gf75ru0KSX0/yPPAIi2f1ved28/d2yz6zCwsLfWqXJPXQJ+gzpK1+qKHqaFW9DngH8OHlzO3mH6qqmaqamZ4e+vdtJUkvQ5+gnwe2DOxvBs5fbXBVfQH42SQblztXkrTy+gT9CWB7km1J1gP3AMcGByT5uSTptm8F1gPf6DNXkjReI591U1WXkuwHHgOmgMNVdSrJvq7/IPAbwLuTfB/4X+A3u1/ODp07pu8iSRqi10PNquo4cHxJ28GB7Y8AH+k7V5J0/XhnrCQ1zqCXpMYZ9JLUOINekhpn0EtS4wx6SWqcQS9JjTPoJalxBr0kNc6gl6TGGfSS1DiDXpIaZ9BLUuM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5PMA39cVR+fbFUj3Qa8C3imW/MG+KOqOj65kka6GfhEd2XWK4C/rao1ccniGvJq4OjieQDrgIer6tHJltTL7wKf6k4Oz9A9AmY18fJKSWqcSzeS1DiDXpIaZ9BLUuMMeklqnEEvSY0z6CWpcQa9JDXu/wEPIK77eHdQnAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 预测 K24P12 结果分布\n",
    "df2 = pd.read_csv('/Users/gengyunxin/Documents/项目/traffic_model/TVTS_9.28/finetune/test_result_all/prediction_result_step36/24_12_0.1_step36.csv')\n",
    "a,b,c,d,e,f,g = [],[],[],[],[],[],[]\n",
    "input_array = list(df2['Predict'])\n",
    "for i, input in enumerate(input_array):\n",
    "    if 0.00001<=input<0.001:\n",
    "        a.append(input_array[i])\n",
    "    elif 0.001<=input<0.1:\n",
    "        b.append(input_array[i])\n",
    "    elif 0.1<=input<1:\n",
    "        c.append(input_array[i])\n",
    "    elif 1<=input<10:\n",
    "        d.append(input_array[i])\n",
    "    elif 10<=input<50:\n",
    "        e.append(input_array[i])\n",
    "    elif 50<=input<100:\n",
    "        f.append(input_array[i])\n",
    "    else:\n",
    "        g.append(input_array[i])\n",
    "y = [len(m)/len(df2['Predict']) for m in [a,b,c,d,e,f,g]]\n",
    "x = np.arange(7)\n",
    "print(y)\n",
    "plt.bar(x, y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "def cal_mape(true, predict, num):\n",
    "    return (sum(abs(true - predict) / (true + 1e-6))) / num"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "89856"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "num = len(df1['Position'])\n",
    "num"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "7037.801319921469"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mape = cal_mape(df1['Input288'], df1['Complementation'], num)\n",
    "mape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.05403680365104907"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "input12 = [32.1,32.6,\n",
    "33.5,\n",
    "33.9,\n",
    "33.4,\n",
    "34.8,\n",
    "36.5,\n",
    "37.6,\n",
    "39.199997,\n",
    "40.3,\n",
    "41.8,\n",
    "41.600002]\n",
    "comple12 = [36.199474,\n",
    "34.52239,\n",
    "35.43811,\n",
    "36.267235,\n",
    "36.336258,\n",
    "36.99513,\n",
    "37.765316,\n",
    "39.69525,\n",
    "40.87546,\n",
    "41.074806,\n",
    "43.013424,\n",
    "41.52923]\n",
    "mape = mean_absolute_percentage_error(input12, comple12)\n",
    "mape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1.8794690000000014"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mae = mean_absolute_error(input12, comple12)\n",
    "mae"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2.1248049575134744"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "rmse = mean_squared_error(input12, comple12, squared=False)\n",
    "rmse"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.6125447000859008"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r2 = r2_score(input12, comple12)\n",
    "r2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python [conda env:pytorch1.6.0] *",
   "language": "python",
   "name": "conda-env-pytorch1.6.0-py"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
